package com.cn.activitiNSV.configuration.httpclient;

import org.apache.http.HttpHost;
import org.apache.http.impl.conn.DefaultProxyRoutePlanner;
import org.springframework.core.env.Environment;

/**
 * @Author: Eric
 **/
//@Configuration
public class CustomDefaultProxyRoutePlanner {

    //@Resource
    private Environment environment;

    //@Bean
    public DefaultProxyRoutePlanner defaultProxyRoutePlanner() {
        HttpHost proxy = new HttpHost(environment.getProperty("httpClient.config.proxyHost"), environment.getProperty("httpClient.config.proxyPort", Integer.class));
        return new DefaultProxyRoutePlanner(proxy);
    }
}
